<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page language="java" import="com.base.myproject.client.jdbc.DataSet"%>
<%@page language="java" import="com.base.myproject.server.tools.DataSetTool"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<style type="text/css">
<!--
body {
    font-family:楷体_GB2312;
    font-size:22px;
}
.height3 {
    height:3px;
}
.height20 {
    height:21px;
}
.height27 {
    height:28px;
}
.smore {
    font-size:18.5px;
    font-family:"Arial","sans-serif";
}
-->
</style>
<%
	String bcode = request.getParameter("bcode");
	DataSetTool DST = new DataSetTool();
	String sql = "select bname as Cname,hr_firstname_en as Ename,Identifier+bcode as " + 
	"bcodeNum,(select name from systeminfo where id = up_department) as Cdepartment,enName as Edepartment,bcodeimagepath as image from(select bcode,bname,Identifier,hr_firstname_en,up_department " +
	"from bcode where bcode='"+bcode+"')as a,(select bcodeimagepath from bcode_images where bcode='"+bcode+"')as b,(select enName from Systeminfo where id=(select up_department from bcode " +
	"where bcode='"+bcode+"')) as c";
	DataSet ds = DST.getDataSet(sql);
	
	String cname = " ",ename = " ",bcodenum = " ",cdepartment = " ",edepartment = " ",imagepath="";
	if(ds.getRowCount() > 0){
		cname = ds.getValue(0,"Cname");
		ename = ds.getValue(0,"Ename") != null ? ds.getValue(0,"Ename") : " ";
		String firstWord = ename.substring(0, 1);
		String otherWord = ename.substring(1);
		ename = firstWord.toUpperCase() + otherWord.toLowerCase();
		bcodenum = ds.getValue(0,"bcodeNum");
		cdepartment = ds.getValue(0,"Cdepartment");
		edepartment = ds.getValue(0, "Edepartment") != null ? ds.getValue(0, "Edepartment") : " ";
		imagepath = ds.getValue(0,"image"); 
	}else
		System.out.println("找不到员工照片");
%>
</head>

<body>
<table>
  <tr>
    <td width="165"><B><%=cname %></B></td>
    <td width="149" rowspan="8"><table  width="100%" height="100%" border="0">
      <tr>
        <td  valign="top" align="center">&nbsp;<img src="../<%=imagepath %>" width="145" height="180" ></td>
      </tr>
    </table></td>
  </tr>
  <tr class="height3">
    <td></td>
  </tr>
  <tr>
    <td style='font-family:"Arial","sans-serif"'><%=ename %></td>
  </tr>
  <tr class="height20">
    <td></td>
  </tr>
  <tr>
    <td style='font-family:"Arial","sans-serif"'><%=bcodenum %></td>
  </tr>
  <tr class="height27">
    <td></td>
  </tr>
  <tr>
    <td><B><%=cdepartment %></B></td>
  </tr>
  <tr>
    <td class="smore"><%=edepartment %></td>
  </tr>
</table>
</body>
</html>
